#include <iostream>
#include <map>

using namespace std;

bool comp(const pair <string, int >& a, const pair <string, int>& b)
{
    return a.second > b.second;
}

int main()
{
    map <string, int> ac {
        {"apple", 1},
        {"banana", 2},
        {"cherry", 3}
    };

    vector <pair<string, int>> vec(ac.begin(), ac.end());
    sort(vec.begin(), vec.end(), comp);

    for (auto it = vec.begin(); it != vec.end(); ++it) {
        cout << it->first << ":" << it->second << endl;
    }

    return 0;
}
